
// 加不加返回类型看个人喜好
function sum(num1: number, num2: number): number {
    return num1 + num2
}

// 对象类型
function printPoint(point:{x: number,y:number,z?:number}){
    console.log(point.x);
    console.log(point.y);
    console.log(point.z);
}
printPoint({x:123,y:456}) 

// 1和2是一样的意思
// 1
function print(message?: string){
}
// 2
// function print(message: string|undefined){
// }

// 类的别名
type IDType = string | number | boolean
type PointType = {
    x: number
    y: number
    z?: number
}
function pay(id:IDType){

}

function printDay(id:PointType){}

export {}